
#pragma once


namespace __OCF_STUB__ 
{


using namespace __OCF_BASE__;

#define MAX_CHANNEL_INPUT	(32)
#define MAX_CHANNEL_NAME	(80)
#define MAX_PACKET_SIZE	(0xFFFF)


#pragma pack(1)

typedef struct
{
	LONG m_lUsers;
	LONG m_lChannelNumber;
	BYTE m_byAttr;
	char m_achChannelName[MAX_CHANNEL_NAME];
}_CHANNEL_INFO_T;

#pragma pack()




template <class IF>
class CUserToGateway
{
	typedef TYPE_LIST12(BYTE,BYTE*,USHORT,USHORT*,_CHANNEL_INFO_T,_CHANNEL_INFO_T*,char,char*,int,int*,long,long*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnCharLoading__ = 151,
		__ENUM_FUNCTION_TYPE_fnCharCreate__ = 152,
		__ENUM_FUNCTION_TYPE_fnCharDelete__ = 153,
		__ENUM_FUNCTION_TYPE_fnCharSelect__ = 154,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CUserToGateway<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CUserToGateway(_N_IF_T* pcIf = NULL)
		:m_pcIf(pcIf)
	{
		m_ulLenRcvBuff = 0;
		m_pRcvBuff = NULL;
		m_pCurrRcvBuff = NULL;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = 0;
		m_pSndBuff = NULL;
#endif
		m_ulBindX = 0;
		m_ulIdentity = 0;

	}
	virtual ~CUserToGateway()
	{
	}
	CUserToGateway& operator =(const CUserToGateway& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLenRcvBuff = cFrom.m_ulLenRcvBuff;
		m_pRcvBuff = cFrom.m_pRcvBuff;
		m_pCurrRcvBuff = cFrom.m_pCurrRcvBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = cFrom.m_ulLenSndBuff;
		m_pSndBuff = cFrom.m_pSndBuff;
#endif
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLenRcvBuff, m_pRcvBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -3;
		}
		if (uiCmd >= __END__)
		{
			return -4;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -5;
		}

		long lRet = (this->*m_apcFunc[uiCmd])(cIn);
		if (0 <= lRet)
		{
			m_pCurrRcvBuff = cIn.GetCurrDataPtr();
		}

		return lRet; 
	}

public:
	inline void SetIf(_N_IF_T* pcIf) { m_pcIf = pcIf; }

#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff, ULONG ulLenSndBuff = 0, void* pSndBuff = NULL) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; m_ulLenSndBuff = ulLenSndBuff; m_pSndBuff = pSndBuff; }

	inline ULONG GetLengthRcvBuff() { return m_ulLenRcvBuff; }
	inline ULONG GetLengthSndBuff() { return m_ulLenSndBuff; }
	inline void* GetRcvBuff() { return m_pRcvBuff; }
	inline void* GetSndBuff() { return m_pSndBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#else
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; }

	inline ULONG GetLengthSndBuff() { return m_ulLenRcvBuff; }
	inline void* GetSndBuff() { return m_pRcvBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#endif
private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }
private:
	long fnCharLoading(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnCharLoading(GetBindX(),GetIdentity());
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnCharCreate(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE bySlot;ULONG nLenCharName;char * pszCharName;char nGender;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(bySlot).Pop(nLenCharName,(const char ** )(&pszCharName)).Pop(nGender).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnCharCreate(GetBindX(),GetIdentity(),bySlot,(int )nLenCharName,pszCharName,nGender);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnCharDelete(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE bySlot;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(bySlot).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnCharDelete(GetBindX(),GetIdentity(),bySlot);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnCharSelect(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE bySlot;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(bySlot).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnCharSelect(GetBindX(),GetIdentity(),bySlot);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}

private:
	static _FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLenRcvBuff;
	const void* m_pRcvBuff;
	const void* m_pCurrRcvBuff;
	ULONG m_ulLenSndBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	void* m_pSndBuff;
#endif
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

template <class IF>
typename CUserToGateway<IF>::_FUNC_T CUserToGateway<IF>::m_apcFunc[__END__] = {
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	&CUserToGateway<IF>::fnCharLoading,
	&CUserToGateway<IF>::fnCharCreate,
	&CUserToGateway<IF>::fnCharDelete,
	&CUserToGateway<IF>::fnCharSelect,
};


#undef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__


template <class IF>
class CGatewayToUser
{
	typedef TYPE_LIST12(BYTE,BYTE*,USHORT,USHORT*,_CHANNEL_INFO_T,_CHANNEL_INFO_T*,char,char*,int,int*,long,long*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnResultCharLoading__ = 551,
		__ENUM_FUNCTION_TYPE_fnResultCharCreate__ = 552,
		__ENUM_FUNCTION_TYPE_fnResultCharDelete__ = 553,
		__ENUM_FUNCTION_TYPE_fnResultCharSelect__ = 554,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CGatewayToUser<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CGatewayToUser(_N_IF_T* pcIf = NULL)
		:m_pcIf(pcIf)
	{
		m_ulLenRcvBuff = 0;
		m_pRcvBuff = NULL;
		m_pCurrRcvBuff = NULL;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = 0;
		m_pSndBuff = NULL;
#endif
		m_ulBindX = 0;
		m_ulIdentity = 0;

	}
	virtual ~CGatewayToUser()
	{
	}
	CGatewayToUser& operator =(const CGatewayToUser& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLenRcvBuff = cFrom.m_ulLenRcvBuff;
		m_pRcvBuff = cFrom.m_pRcvBuff;
		m_pCurrRcvBuff = cFrom.m_pCurrRcvBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = cFrom.m_ulLenSndBuff;
		m_pSndBuff = cFrom.m_pSndBuff;
#endif
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLenRcvBuff, m_pRcvBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -3;
		}
		if (uiCmd >= __END__)
		{
			return -4;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -5;
		}

		long lRet = (this->*m_apcFunc[uiCmd])(cIn);
		if (0 <= lRet)
		{
			m_pCurrRcvBuff = cIn.GetCurrDataPtr();
		}

		return lRet; 
	}

public:
	inline void SetIf(_N_IF_T* pcIf) { m_pcIf = pcIf; }

#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff, ULONG ulLenSndBuff = 0, void* pSndBuff = NULL) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; m_ulLenSndBuff = ulLenSndBuff; m_pSndBuff = pSndBuff; }

	inline ULONG GetLengthRcvBuff() { return m_ulLenRcvBuff; }
	inline ULONG GetLengthSndBuff() { return m_ulLenSndBuff; }
	inline void* GetRcvBuff() { return m_pRcvBuff; }
	inline void* GetSndBuff() { return m_pSndBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#else
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; }

	inline ULONG GetLengthSndBuff() { return m_ulLenRcvBuff; }
	inline void* GetSndBuff() { return m_pRcvBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#endif
private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }
private:
	long fnResultCharLoading(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE byRes;ULONG nLenCharData;char * pCharData;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(byRes).Pop(nLenCharData,(const char ** )(&pCharData)).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnResultCharLoading(GetBindX(),GetIdentity(),byRes,(int )nLenCharData,pCharData);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnResultCharCreate(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE byRes;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(byRes).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnResultCharCreate(GetBindX(),GetIdentity(),byRes);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnResultCharDelete(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE byRes;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(byRes).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnResultCharDelete(GetBindX(),GetIdentity(),byRes);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnResultCharSelect(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE byRes;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(byRes).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnResultCharSelect(GetBindX(),GetIdentity(),byRes);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}

private:
	static _FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLenRcvBuff;
	const void* m_pRcvBuff;
	const void* m_pCurrRcvBuff;
	ULONG m_ulLenSndBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	void* m_pSndBuff;
#endif
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

template <class IF>
typename CGatewayToUser<IF>::_FUNC_T CGatewayToUser<IF>::m_apcFunc[__END__] = {
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	&CGatewayToUser<IF>::fnResultCharLoading,
	&CGatewayToUser<IF>::fnResultCharCreate,
	&CGatewayToUser<IF>::fnResultCharDelete,
	&CGatewayToUser<IF>::fnResultCharSelect,
};


#undef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__


template <class IF>
class CRoomToGw
{
	typedef TYPE_LIST12(BYTE,BYTE*,USHORT,USHORT*,_CHANNEL_INFO_T,_CHANNEL_INFO_T*,char,char*,int,int*,long,long*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnFetchChannelInfo__ = 10,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CRoomToGw<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CRoomToGw(_N_IF_T* pcIf = NULL)
		:m_pcIf(pcIf)
	{
		m_ulLenRcvBuff = 0;
		m_pRcvBuff = NULL;
		m_pCurrRcvBuff = NULL;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = 0;
		m_pSndBuff = NULL;
#endif
		m_ulBindX = 0;
		m_ulIdentity = 0;

	}
	virtual ~CRoomToGw()
	{
	}
	CRoomToGw& operator =(const CRoomToGw& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLenRcvBuff = cFrom.m_ulLenRcvBuff;
		m_pRcvBuff = cFrom.m_pRcvBuff;
		m_pCurrRcvBuff = cFrom.m_pCurrRcvBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = cFrom.m_ulLenSndBuff;
		m_pSndBuff = cFrom.m_pSndBuff;
#endif
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLenRcvBuff, m_pRcvBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -3;
		}
		if (uiCmd >= __END__)
		{
			return -4;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -5;
		}

		long lRet = (this->*m_apcFunc[uiCmd])(cIn);
		if (0 <= lRet)
		{
			m_pCurrRcvBuff = cIn.GetCurrDataPtr();
		}

		return lRet; 
	}

public:
	inline void SetIf(_N_IF_T* pcIf) { m_pcIf = pcIf; }

#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff, ULONG ulLenSndBuff = 0, void* pSndBuff = NULL) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; m_ulLenSndBuff = ulLenSndBuff; m_pSndBuff = pSndBuff; }

	inline ULONG GetLengthRcvBuff() { return m_ulLenRcvBuff; }
	inline ULONG GetLengthSndBuff() { return m_ulLenSndBuff; }
	inline void* GetRcvBuff() { return m_pRcvBuff; }
	inline void* GetSndBuff() { return m_pSndBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#else
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; }

	inline ULONG GetLengthSndBuff() { return m_ulLenRcvBuff; }
	inline void* GetSndBuff() { return m_pRcvBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#endif
private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }
private:
	long fnFetchChannelInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		USHORT uiServerID;ULONG lLen;_CHANNEL_INFO_T * pstChannelInfo;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(uiServerID).Pop(lLen,(const _CHANNEL_INFO_T ** )(&pstChannelInfo)).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnFetchChannelInfo(GetBindX(),GetIdentity(),uiServerID,(long )lLen,pstChannelInfo);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}

private:
	static _FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLenRcvBuff;
	const void* m_pRcvBuff;
	const void* m_pCurrRcvBuff;
	ULONG m_ulLenSndBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	void* m_pSndBuff;
#endif
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

template <class IF>
typename CRoomToGw<IF>::_FUNC_T CRoomToGw<IF>::m_apcFunc[__END__] = {
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	&CRoomToGw<IF>::fnFetchChannelInfo,
};


#undef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
}
